<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            width: 300px;
            height: 300px;
            background: red;
        }

        .content {
            width: 200px;
            height: 200px;
            background: blue;
        }

        .inner {
            width: 100px;
            height: 100px;
            background: yellow;
        }
    </style>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <div class="container" @click.once.capture.stop="containerfn">
            <div class="content" @click="contentfn">
                <div class="inner" @click="innerfn">
                </div>
            </div>
        </div>
        <a @click.prevent="gohttp" href="http://www.baidu.com">点击我跳转</a>
    </div>

    <script>
        // v-model  trim number lazy
        // 事件的修饰符 ：
        // 1.stop 阻止事件冒泡
        // e.stopPropagation()
        // 2.prevent阻止默认事件
        // e.preventDefault();
        // 3.capture :把事件触发重冒泡变成捕获 
        // document.addEventListener("click",fn,false)
        // 4.self:只有触发到自身（e.target）的时候才会触发事件
        // 5.once:事件只会被触发一次
        // 和 其他修饰符一样 可以多个混用
        new Vue({
            el: "#app",
            methods:{
                containerfn(){
                    console.log("containerfn")
                },
                contentfn(){
                    console.log("contentfn")
                },
                innerfn(){
                    console.log("innerfn")
                },
                gohttp(){
                    window.location.href = "http://sohu.com";
                }
            }
        })

    </script>
</body>

</html>